import httpRequest from '../../utils/request'
import modules from '../modules'
const defaultRoute = 'Crew_SchedulingPlan'
const controllerName = 'SchedulingPlan'

export interface SchedulingPlanParam {
  SchedulingPlanName: string | null
  PageIndex: number
  PageSize: number
  totalCount: number
 
}


// 获取排班计划列表
export function ApiGetCrew_SchedulingPlanPageListAsync(param: SchedulingPlanParam) {
  return httpRequest({
    url: `${modules.crewModuleUrl}/${controllerName}/Get${defaultRoute}PageList`,
    method: "Post",
    data: param,
  });
}

// 批量删除排班计划
export function ApiDeletionCrew_SchedulingPlanAsync(param: string[]) {
  return httpRequest({
    url: `${modules.crewModuleUrl}/${controllerName}/Deletion${defaultRoute}`,
    method: "Post",
    data: param,
  });
}


// 添加排班计划
export function ApiCreateCrew_SchedulingPlanAsync(param: object) {
  return httpRequest({
    url: `${modules.crewModuleUrl}/${controllerName}/Create${defaultRoute}`,
    method: "Post",
    data: param,
  });
}


//更新排班计划
export function ApiUpdateCrew_SchedulingPlanAsync(param: object) {
  return httpRequest({
    url: `${modules.crewModuleUrl}/${controllerName}/Update${defaultRoute}`,
    method: "Post",
    data: param,
  });
}

// 根据班组id获取排班计划明细列表
export function ApiGetCrew_SchedulingPlanByIdDetialsPageListAsync(param: object) {
  return httpRequest({
    url: `${modules.crewModuleUrl}/${controllerName}/Get${defaultRoute}ByIdDetialsPageList`,
    method: "Post",
    data: param,
  });
}

// 根据班组id获取排班计划
export function ApiGetCrew_SchedulingPlanByIdAsync(param: string) {
  return httpRequest({
    url: `${modules.crewModuleUrl}/${controllerName}/Get${defaultRoute}ById`,
    method: "Post",
    data: {
      SchedulingPlanId:param
    },
  });
}

//根据明细id更新排班计划明细
export function ApiUpdateCrew_SchedulingPlanDetialByIdAsync(param: any) {
  return httpRequest({
    url: `${modules.crewModuleUrl}/${controllerName}/Update${defaultRoute}DetialById`,
    method: "Post",
    data: param,
  });
}
//根据计划Id绑定工单
export function ApiUpdateCrew_SchedulingPlanByBindWorkOrderAsync(param: object) {
  return httpRequest({
    url: `${modules.crewModuleUrl}/${controllerName}/Update${defaultRoute}ByBindWorkOrder`,
    method: "Post",
    data: param,
  });
}